﻿<Window x:Class="Chapter6SuggestedPracticeApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:my="clr-namespace:Chapter6SuggestedPractice;assembly=Chapter6SuggestedPractice">
	<Window.Resources>
		<CollectionViewSource x:Key="albumViewSource" d:DesignSource="{d:DesignInstance my:Album, CreateList=True}" />
		<CollectionViewSource x:Key="songViewSource" d:DesignSource="{d:DesignInstance my:Song, CreateList=True}" />
	</Window.Resources>
	<Grid DataContext="{StaticResource albumViewSource}">
		<Grid.RowDefinitions>
			<RowDefinition Height="auto" />
			<RowDefinition Height="*" />
			<RowDefinition Height="*" />
		</Grid.RowDefinitions>
		<Menu>
			<MenuItem Name="mnuSave" Click="mnuSave_Click" />
			<MenuItem Name="mnuExit" Click="mnuExit_Click" />
		</Menu>
		<DataGrid AutoGenerateColumns="False" EnableRowVirtualization="True" Height="146" HorizontalAlignment="Left" ItemsSource="{Binding}" Margin="0,7,0,0" Name="albumDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Top" Width="503" Grid.Row="1">
			<DataGrid.Columns>
				<DataGridTextColumn x:Name="idColumn" Binding="{Binding Path=Id}" Header="Id" Width="SizeToHeader" Visibility="Hidden" />
				<DataGridTextColumn x:Name="nameColumn" Binding="{Binding Path=Name}" Header="Name" Width="*" />
			</DataGrid.Columns>
		</DataGrid>
		<DataGrid AutoGenerateColumns="False" EnableRowVirtualization="True" Grid.Row="2" Height="153" HorizontalAlignment="Left" ItemsSource="{Binding Source={StaticResource songViewSource}}" Name="songDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Top" Width="503">
			<DataGrid.Columns>
				<DataGridTextColumn x:Name="albumIdColumn" Binding="{Binding Path=AlbumId}" Header="Album Id" Width="SizeToHeader" Visibility="Hidden" />
				<DataGridTextColumn x:Name="idColumn1" Binding="{Binding Path=Id}" Header="Id" Width="SizeToHeader" Visibility="Hidden"/>
				<DataGridTextColumn x:Name="nameColumn1" Binding="{Binding Path=Name}" Header="Name" Width="*"/>
			</DataGrid.Columns>
		</DataGrid>
	</Grid>
</Window>
